Optical, magnetic, and capacitive encoders have existed for many years to provide incremental and absolute motion signals for indicating position for feedback, display, or computing purposes. Optical encoders require an uncontaminated light path from an emitter, through a transmission modulating pattern, to a light sensor. Magnetic and capacitive encoders require paths that provide areas for modulation and detection of energy fields by a moving pattern of code elements with magnetic or electrostatic properties. For example, rotary magnetic encoders are often implemented with a rotatable drum embedded with alternating permanent magnetic poles and a stationary detector array of magnetoresistive elements which sense alternating permanent magnetic fields as the drum is rotated. In some environments, the permanent magnetic fields will attract and hold ferromagnetic particles that can damage or destroy the encoder. Also, if the operating environment includes extraneous magnetic fields from peripheral equipment, such magnetic fields can corrupt the function of the encoder. Furthermore, very high extraneous magnetic field intensities can cause permanent damage to the encoder. Accordingly, it would be desirable to provide a magnetic encoder which does not exhibit and is not subject to the above-mentioned shortcomings.